<?php
//print_r($list);
?>
<div id='tuijian'>
	<div>
		<div class='tui1'></div>
		<div class='tui2'>
			<div class='text_v'>
				今 日 推 荐
			</div>
		</div>
		<div class='tui3'>
			<div class='link' style='color:white;'>			
				<a href='<?php echo JRoute::_('index.php?option=com_products&view=products');?>'>>>更多</a>
			</div>
		</div>
	</div>
	<div class='tuijian_list'>
	<?php 
		if($list){
			$i=0;
			//echo "<div class='row_begin'>";
			foreach ($list as $key=>$val){			
				if($i%3==0){
					echo "<div class='row_begin'>";
				}
				$product_url=JRoute::_('index.php?option=com_products&view=product&layout=view&id='.$val[0]);
				echo "<div class='item'><a href='".$product_url."'>";		
				echo $val[1];
				echo "</a></div>";
				
				if($i%3==2){
					echo "</div>";
				}
				$i++;
			}
			if ($i%3==1){			
				echo "<div class='item'>&nbsp</div><div class='item'>&nbsp</div></div>";
			}elseif($i%3==2){
				echo "<div class='item'>&nbsp</div></div>";
			}
		}
	?>
	</div>
</div>
